from django.contrib import admin
from django.urls import path

from apps.users import views

urlpatterns = [
    path('usernames/<username:username>/count/', views.UsernameCountView.as_view()),
    path('mobiles/<mobile:mobile>/count/', views.MobileCountView.as_view()),
    path('register/', views.RegisterView.as_view()),
    path('login/', views.LoginView.as_view()),
    path('logout/', views.LogoutView.as_view()),
    path('info/', views.UserInfoView.as_view()),
    # 添加邮箱
    path('emails/', views.EmailView.as_view()),
    path('emails/verification/',views.VerifyEmailView.as_view()),
    # 新增收货地址
    path('addresses/create/', views.CreateAddressView.as_view()),
    # 访问地址的子路由:
    path('addresses/', views.AddressView.as_view()),
    # 修改和删除收货地址
    path('addresses/(?P<address_id>\d+)/', views.UpdateDestroyAddressView.as_view()),
]